//package com.parking.mgr.useraccount.controller;
//
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.parking.mgr.common.annotion.BusinessLog;
//import com.parking.mgr.common.annotion.LoginAuth;
//import com.parking.mgr.common.annotion.PermissionUrl;
//import com.parking.mgr.common.enums.LogAnnotionOpTypeEnum;
//import com.parking.mgr.common.pojo.page.PageResult;
//import com.parking.mgr.common.pojo.response.Result;
//import com.parking.mgr.useraccount.model.param.BasicRoleMenuParam;
//import com.parking.mgr.useraccount.model.vo.BasicRoleMenuVO;
//import com.parking.mgr.useraccount.service.BasicRoleMenuService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import java.util.Collection;
//import java.util.List;
//
///**
// * @ClassName BasicRoleMenuController
// * @Description 角色功能菜单
// * @Auther: shilintao
// * @Date: 2023/5/30
// */
//@Api(value = "角色功能菜单", tags = {"角色功能菜单"})
//@RequestMapping("/api/basic/rolemenu")
//@RestController
//public class BasicRoleMenuController {
//
//    @Resource
//    private BasicRoleMenuService basicRoleMenuService;
//
//    /**
//     * 角色菜单列表
//     *
//     * @param basicRoleMenuParam
//     * @return
//     */
//    @GetMapping("/list")
//    @ApiOperation(value = "角色菜单列表", notes = "角色菜单列表", httpMethod = "GET")
//    @PermissionUrl
//    public Result<?> list(BasicRoleMenuParam basicRoleMenuParam) {
//        IPage<BasicRoleMenuVO> roleMenuIPageVO = (IPage<BasicRoleMenuVO>) basicRoleMenuService.list(basicRoleMenuParam);
//        List<BasicRoleMenuVO> roleMenuPageList = roleMenuIPageVO.getRecords();
//        PageResult<BasicRoleMenuVO> pageResult = new PageResult((Page) roleMenuIPageVO);
//        return Result.success(roleMenuPageList, pageResult);
//    }
//
//    @GetMapping("/listenable")
//    @ApiOperation(value = "角色菜单列表(启用状态)", notes = "角色菜单列表(启用状态)", httpMethod = "GET")
//    @PermissionUrl
//    public Result<?> listEnable(BasicRoleMenuParam basicRoleMenuParam) {
//        IPage<BasicRoleMenuVO> roleMenuIPageVO = (IPage<BasicRoleMenuVO>) basicRoleMenuService.listEnable(basicRoleMenuParam);
//        List<BasicRoleMenuVO> roleMenuPageList = roleMenuIPageVO.getRecords();
//        PageResult<BasicRoleMenuVO> pageResult = new PageResult((Page) roleMenuIPageVO);
//        return Result.success(roleMenuPageList, pageResult);
//    }
//
//
//    /**
//     * 添加角色菜单
//     *
//     * @param basicRoleMenuParam
//     * @return
//     */
//    @PostMapping("/add")
//    @ApiOperation(value = "添加角色菜单", notes = "添加角色菜单", httpMethod = "POST")
//    @BusinessLog(title = "角色菜单_添加", opType = LogAnnotionOpTypeEnum.ADD)
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> add(@RequestBody @Validated(BasicRoleMenuParam.add.class) BasicRoleMenuParam basicRoleMenuParam) {
//        basicRoleMenuService.add(basicRoleMenuParam);
//        return Result.success();
//    }
//
//    /**
//     * 删除角色菜单
//     *
//     * @param ids
//     * @return
//     */
//    @PostMapping("/delete")
//    @ApiOperation(value = "删除角色菜单", notes = "删除角色菜单", httpMethod = "POST")
//    @BusinessLog(title = "角色菜单_删除", opType = LogAnnotionOpTypeEnum.DELETE)
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> delete(@ApiParam(name = "id", value = "id", required = true)
//                            @RequestParam(name = "id", required = true)
//                            Collection<String> ids) {
//        basicRoleMenuService.delete(ids);
//        return Result.success();
//    }
//
//    /**
//     * 编辑角色菜单
//     *
//     * @param basicRoleMenuParam
//     * @return
//     */
//    @PostMapping("/edit")
//    @ApiOperation(value = "编辑角色菜单", notes = "编辑角色菜单", httpMethod = "POST")
//    @BusinessLog(title = "角色菜单_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> edit(@RequestBody @Validated(BasicRoleMenuParam.edit.class) BasicRoleMenuParam basicRoleMenuParam) {
//        basicRoleMenuService.edit(basicRoleMenuParam);
//        return Result.success();
//    }
//
//    /**
//     * 根据fkBasicRoleId获取已分配的菜单
//     *
//     * @param fkBasicRoleId
//     * @return
//     */
//    @PostMapping("/assignmenu")
//    @ApiOperation(value = "获取已分配的菜单", notes = "获取已分配的菜单", httpMethod = "POST")
//    @BusinessLog(title = "获取已分配的菜单")
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> getAssignMenuIdListByRoleId(@ApiParam(name = "fkBasicRoleId", value = "fkBasicRoleId", required = true)
//                                                 @RequestParam(name = "fkBasicRoleId", required = true)
//                                                 String fkBasicRoleId) {
//        List<String> assignMenuIdVOList = basicRoleMenuService.getAssignMenuIdListByRoleId(fkBasicRoleId);
//        return Result.success(assignMenuIdVOList);
//    }
//
//
//}
